package cn.chengdu.controller;


import cn.chengdu.entity.Department;
import cn.chengdu.service.IDepartmentService;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


import java.util.List;

/**
 * <p>
 * 科室表 前端控制器
 * </p>
 *
 * @author jobob
 * @since 2019-11-14
 */
@Controller
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    private IDepartmentService iDepartmentService;

   @RequestMapping("/category")
   @ResponseBody
    public String selectall(){

       List<Department> list=iDepartmentService.selectall();
       System.out.println("controller>>>>>>>>>>>"+ JSON.toJSONString(list));

        return JSON.toJSONString(list);
    }




}
